#[test]
fn test_max_product_without_common_letters() {

}

// 318
fn max_product(words: Vec<String>) -> i32 {
    let mut bitmap: Vec<u32> = vec![];
    bitmap.reserve(words.len());
    for w in &words {
        let mut bits = 0;
        for c in w.chars() {
            bits |= 1 << (c as usize - 'a' as usize);
        }
        bitmap.push(bits);
    }
    let mut ans = 0;
    for i in 0..words.len() {
        for j in (i+1)..words.len() {
            if bitmap[i] & bitmap[j] == 0 {
                let product = words[i].len() * words[j].len();
                ans = if product > ans {
                    product
                } else {
                    ans
                };
            }
        }
    }
    ans as i32
}

fn get_signed(x: f32) -> u32 {
    x.to_bits() >> 31
}